﻿@{
    ViewBag.Title = "海关编码》表单页面";
    Layout = "~/Views/Shared/_LayoutForm.cshtml";
}

<script type="text/javascript">
    $(function () {
        bindYYYYList();
    })

    //保存事件
    function AcceptClick() {
        if (!CheckDataValid('#form1')) {
            return false;
        }
        var yyyyOld = $("#YYYY_OLD").val();
        var yyyyNew = $("#YYYY_NEW").val();
        var postData = { yyyyOld: yyyyOld, yyyyNew: yyyyNew};
        AjaxJson("/CommonModule/BmsCustomItem/SubmitCopy", postData, function (data) {
            tipDialog(data.Message, 3, data.Code);
            top.frames[tabiframeId()].windowload();
            closeDialog();
        });
    }

    //加载已有适用年限
    function bindYYYYList() {
        AjaxJson("/CommonModule/BmsCustomItem/bindYYYYList", null, function (data) {
            var selid = $("#YYYY_OLD");
            selid.append("<option value=''>请选择</option>");
            $.each(data, function (i) {
                selid.append("<option value='" + data[i] + "'>" + data[i] + "</option>");
            })
        });
    }
</script>

<form id="form1" style="margin: 1px">
    <div id="message" style="display: none"></div>
    <table class="form">
        <tr>
            <th class='formTitle'>现有适用年限：</th>
            <td class='formValue'>
                <select id="YYYY_OLD" class="select" style="width: 300px"></select>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>新的适用年限：</th>
            <td class='formValue'>
                <input id="YYYY_NEW" maxlength=4 type="text" class="txt" datacol="yes" err="新的适用年限" checkexpession="Num" />
            </td>
        </tr>
    </table>
</form>
